<!doctype html>
<html>
<head>
	<meta charset="utf-8">
	<title></title>
	<link rel="stylesheet" href="${staticServer}/inc/style/main.css"/>
	<link rel="stylesheet" href="${staticServer}/inc/style/page.css"/>
	<link rel="stylesheet" href="${staticServer}/css/consultant_client.css"/>
	<link rel="stylesheet" href="${staticServer}/inc/style/date/datepicker.css" />
	<script src="${staticServer}/inc/js/jquery.js"></script>
	<script src="${staticServer}/inc/js/pageset.js"></script>
	<script src="${staticServer}/inc/js/datepicker.js"></script>
	<script src="${staticServer}/js/web/system_reserve_stat.js?1.0"></script>
	<script src="${staticServer}/js/web/echarts.js"></script>
	<script src="${staticServer}/js/web/esl.js"></script>
</head>

<body>
	<div id="home_link">
		<ul>
			<li>竞思教育网络办公系统 v2.0 beta</li>
			<li>&gt;</li>
			<li>咨询师</li>
			<li>&gt;</li>
			<li class="current">客户资源统计</li>
		</ul>
	</div>
	<div id="container">
		<div id="title">客户资源统计</div>
		
		<table class="form_table">
			<tbody>
			<tr class="even_row">
				<td>
					<label><b>查询条件：</b></label>
					<label for="start_date">来源入口：</label>
					<select id="type">
						<option value="1">网推入口</option>
						<option value="2">机构合作</option>
						<option value="3">竞价入口</option>
						<option value="4">市场入口</option>
						<option value="5">文创入口</option>
					</select>
					<label for="start_date">选择日期：</label>
						<input type="text" name="start_date" id="start_date" size="15" value="${time}" rel="DATE::Y-m" readonly="readonly" class="DatePicker_Icon"> 
					<input type="button" value=" 查 询 " onclick="selectMsg()">
				</td>
			</tr>
		</tbody></table>
		
		<table>
			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;资源统计：
			<tr>
				<div id="week" style="height:400px"></div>
			</tr>
		</table>
		
	</div>
</body>

<script>
	$(function(){
		$("#type").val("${type}");
	});
	var selectMsg = function(){
		var startTime = $("#start_date").val();
		window.location.href=encodeURI("${contextPath}/statis/system_channel_statis.htm?time="+startTime+"&type="+$("#type").val());
	}
	
<#if type??>
	<#if type=="1">
		var time = [<#if datelist??><#list datelist as list>'${list}',</#list></#if>];
		var tglist = [<#if tglist??><#list tglist as list>'<#if list?? && list!="">${list}<#else>0</#if>',</#list></#if>];
		var sqlist = [<#if sqlist??><#list sqlist as list>'<#if list?? && list!="">${list}<#else>0</#if>',</#list></#if>];
		var sblist = [<#if sblist??><#list sblist as list>'<#if list?? && list!="">${list}<#else>0</#if>',</#list></#if>];
		var bmlist = [<#if bmlist??><#list bmlist as list>'<#if list?? && list!="">${list}<#else>0</#if>',</#list></#if>];
		var qqlist = [<#if qqlist??><#list qqlist as list>'<#if list?? && list!="">${list}<#else>0</#if>',</#list></#if>];
		var gjlist = [<#if gjlist??><#list gjlist as list>'<#if list?? && list!="">${list}<#else>0</#if>',</#list></#if>];
		var wblist = [<#if wblist??><#list wblist as list>'<#if list?? && list!="">${list}<#else>0</#if>',</#list></#if>];
		var jylist = [<#if jylist??><#list jylist as list>'<#if list?? && list!="">${list}<#else>0</#if>',</#list></#if>];
		var yxlist = [<#if yxlist??><#list yxlist as list>'<#if list?? && list!="">${list}<#else>0</#if>',</#list></#if>];
		
		require.config({
	        paths:{ 
	            'echarts' : 'http://echarts.baidu.com/build/echarts',
	            'echarts/chart/bar' : 'http://echarts.baidu.com/build/echarts'
	        }
	    });
	    
	    // 周统计
	    require(
	        [
	            'echarts',
	            'echarts/chart/bar' // 使用柱状图就加载bar模块，按需加载
	        ],
	        function (ec) {
	            // 基于准备好的dom，初始化echarts图表
	            var myChart = ec.init(document.getElementById('week')); 
	            
	            option = {
				    tooltip : {
				        trigger: 'axis'
				    },
				    legend: {
				        data:['推广问卷','商桥','400转分机','网站报名','QQ来源','赶集网','58同城','教育联展网','云销客']
				    },
				    toolbox: {
				        show : true,
				        feature : {
				            mark : {show: true},
				            dataView : {show: true, readOnly: false},
				            magicType : {show: true, type: ['line', 'bar', 'stack', 'tiled']},
				            restore : {show: true},
				            saveAsImage : {show: true}
				        }
				    },
				    calculable : true,
				    xAxis : [
				        {
				            type : 'category',
				            boundaryGap : false,
				            data : time
				        }
				    ],
				    yAxis : [
				        {
				            type : 'value'
				        }
				    ],
				    series : [
				        {
				            name:'推广问卷',
				            type:'line',
				            data:tglist
				        },
				        {
				            name:'商桥',
				            type:'line',
				            data:sqlist
				        },
				        {
				            name:'400转分机',
				            type:'line',
				            data:sblist
				        },
				        {
				            name:'网站报名',
				            type:'line',
				            data:bmlist
				        },
				        {
				            name:'QQ来源',
				            type:'line',
				            data:qqlist
				        },
				        {
				            name:'赶集网',
				            type:'line',
				            data:gjlist
				        },
				        {
				            name:'58同城',
				            type:'line',
				            data:wblist
				        },
				        {
				            name:'教育联展网',
				            type:'line',
				            data:jylist
				        },
				        {
				            name:'云销客',
				            type:'line',
				            data:yxlist
				        }
				    ]
				};
	    
	            // 为echarts对象加载数据 
	            myChart.setOption(option); 
	        }
	    );
    <#elseif type=="2">
    	var time = [<#if datelist??><#list datelist as list>'${list}',</#list></#if>];
		var hhlist = [<#if hhlist??><#list hhlist as list>'<#if list?? && list!="">${list}<#else>0</#if>',</#list></#if>];
		var pxlist = [<#if pxlist??><#list pxlist as list>'<#if list?? && list!="">${list}<#else>0</#if>',</#list></#if>];
		var fxlist = [<#if fxlist??><#list fxlist as list>'<#if list?? && list!="">${list}<#else>0</#if>',</#list></#if>];
		var sxlist = [<#if sxlist??><#list sxlist as list>'<#if list?? && list!="">${list}<#else>0</#if>',</#list></#if>];
		var sjlist = [<#if sjlist??><#list sjlist as list>'<#if list?? && list!="">${list}<#else>0</#if>',</#list></#if>];
		
		require.config({
	        paths:{ 
	            'echarts' : 'http://echarts.baidu.com/build/echarts',
	            'echarts/chart/bar' : 'http://echarts.baidu.com/build/echarts'
	        }
	    });
	    
	    // 周统计
	    require(
	        [
	            'echarts',
	            'echarts/chart/bar' // 使用柱状图就加载bar模块，按需加载
	        ],
	        function (ec) {
	            // 基于准备好的dom，初始化echarts图表
	            var myChart = ec.init(document.getElementById('week')); 
	            
	            option = {
				    tooltip : {
				        trigger: 'axis'
				    },
				    legend: {
				        data:['哈哈儿童','培训通','返学费','搜学校','19楼']
				    },
				    toolbox: {
				        show : true,
				        feature : {
				            mark : {show: true},
				            dataView : {show: true, readOnly: false},
				            magicType : {show: true, type: ['line', 'bar', 'stack', 'tiled']},
				            restore : {show: true},
				            saveAsImage : {show: true}
				        }
				    },
				    calculable : true,
				    xAxis : [
				        {
				            type : 'category',
				            boundaryGap : false,
				            data : time
				        }
				    ],
				    yAxis : [
				        {
				            type : 'value'
				        }
				    ],
				    series : [
				        {
				            name:'哈哈儿童',
				            type:'line',
				            data:hhlist
				        },
				        {
				            name:'培训通',
				            type:'line',
				            data:pxlist
				        },
				        {
				            name:'返学费',
				            type:'line',
				            data:fxlist
				        },
				        {
				            name:'搜学校',
				            type:'line',
				            data:sxlist
				        },
				        {
				            name:'19楼',
				            type:'line',
				            data:sjlist
				        }
				    ]
				};
	    
	            // 为echarts对象加载数据 
	            myChart.setOption(option); 
	        }
	    );
    <#elseif type=="3">
    	var time = [<#if datelist??><#list datelist as list>'${list}',</#list></#if>];
		var wzwjlist = [<#if wzwjlist??><#list wzwjlist as list>'<#if list?? && list!="">${list}<#else>0</#if>',</#list></#if>];
		var sjwjlist = [<#if sjwjlist??><#list sjwjlist as list>'<#if list?? && list!="">${list}<#else>0</#if>',</#list></#if>];
		var wzbmlist = [<#if wzbmlist??><#list wzbmlist as list>'<#if list?? && list!="">${list}<#else>0</#if>',</#list></#if>];
		var bdlist = [<#if bdlist??><#list bdlist as list>'<#if list?? && list!="">${list}<#else>0</#if>',</#list></#if>];
		var ttlist = [<#if ttlist??><#list ttlist as list>'<#if list?? && list!="">${list}<#else>0</#if>',</#list></#if>];
		
		require.config({
	        paths:{ 
	            'echarts' : 'http://echarts.baidu.com/build/echarts',
	            'echarts/chart/bar' : 'http://echarts.baidu.com/build/echarts'
	        }
	    });
	    
	    // 周统计
	    require(
	        [
	            'echarts',
	            'echarts/chart/bar' // 使用柱状图就加载bar模块，按需加载
	        ],
	        function (ec) {
	            // 基于准备好的dom，初始化echarts图表
	            var myChart = ec.init(document.getElementById('week')); 
	            
	            option = {
				    tooltip : {
				        trigger: 'axis'
				    },
				    legend: {
				        data:['网站问卷','手机问卷','网站报名','百度产品','今日头条']
				    },
				    toolbox: {
				        show : true,
				        feature : {
				            mark : {show: true},
				            dataView : {show: true, readOnly: false},
				            magicType : {show: true, type: ['line', 'bar', 'stack', 'tiled']},
				            restore : {show: true},
				            saveAsImage : {show: true}
				        }
				    },
				    calculable : true,
				    xAxis : [
				        {
				            type : 'category',
				            boundaryGap : false,
				            data : time
				        }
				    ],
				    yAxis : [
				        {
				            type : 'value'
				        }
				    ],
				    series : [
				        {
				            name:'网站问卷',
				            type:'line',
				            data:wzwjlist
				        },
				        {
				            name:'手机问卷',
				            type:'line',
				            data:sjwjlist
				        },
				        {
				            name:'网站报名',
				            type:'line',
				            data:wzbmlist
				        },
				        {
				            name:'百度产品',
				            type:'line',
				            data:bdlist
				        },
				        {
				            name:'今日头条',
				            type:'line',
				            data:ttlist
				        }
				    ]
				};
	    
	            // 为echarts对象加载数据 
	            myChart.setOption(option); 
	        }
	    );
    <#elseif type=="4">
    	var time = [<#if datelist??><#list datelist as list>'${list}',</#list></#if>];
		var gylist = [<#if gylist??><#list gylist as list>'<#if list?? && list!="">${list}<#else>0</#if>',</#list></#if>];
		var cdlist = [<#if cdlist??><#list cdlist as list>'<#if list?? && list!="">${list}<#else>0</#if>',</#list></#if>];
		var sclist = [<#if sclist??><#list sclist as list>'<#if list?? && list!="">${list}<#else>0</#if>',</#list></#if>];
		
		require.config({
	        paths:{ 
	            'echarts' : 'http://echarts.baidu.com/build/echarts',
	            'echarts/chart/bar' : 'http://echarts.baidu.com/build/echarts'
	        }
	    });
	    
	    // 周统计
	    require(
	        [
	            'echarts',
	            'echarts/chart/bar' // 使用柱状图就加载bar模块，按需加载
	        ],
	        function (ec) {
	            // 基于准备好的dom，初始化echarts图表
	            var myChart = ec.init(document.getElementById('week')); 
	            
	            option = {
				    tooltip : {
				        trigger: 'axis'
				    },
				    legend: {
				        data:['公益讲座','传单派发','市场推广']
				    },
				    toolbox: {
				        show : true,
				        feature : {
				            mark : {show: true},
				            dataView : {show: true, readOnly: false},
				            magicType : {show: true, type: ['line', 'bar', 'stack', 'tiled']},
				            restore : {show: true},
				            saveAsImage : {show: true}
				        }
				    },
				    calculable : true,
				    xAxis : [
				        {
				            type : 'category',
				            boundaryGap : false,
				            data : time
				        }
				    ],
				    yAxis : [
				        {
				            type : 'value'
				        }
				    ],
				    series : [
				        {
				            name:'公益讲座',
				            type:'line',
				            data:gylist
				        },
				        {
				            name:'传单派发',
				            type:'line',
				            data:cdlist
				        },
				        {
				            name:'市场推广',
				            type:'line',
				            data:sclist
				        }
				    ]
				};
	    
	            // 为echarts对象加载数据 
	            myChart.setOption(option); 
	        }
	    );
    <#elseif type=="5">
    	var time = [<#if datelist??><#list datelist as list>'${list}',</#list></#if>];
		var wbolist = [<#if wbolist??><#list wbolist as list>'<#if list?? && list!="">${list}<#else>0</#if>',</#list></#if>];
		var ttlist2 = [<#if ttlist2??><#list ttlist2 as list>'<#if list?? && list!="">${list}<#else>0</#if>',</#list></#if>];
		var wxlist = [<#if wxlist??><#list wxlist as list>'<#if list?? && list!="">${list}<#else>0</#if>',</#list></#if>];
		
		require.config({
	        paths:{ 
	            'echarts' : 'http://echarts.baidu.com/build/echarts',
	            'echarts/chart/bar' : 'http://echarts.baidu.com/build/echarts'
	        }
	    });
	    
	    // 周统计
	    require(
	        [
	            'echarts',
	            'echarts/chart/bar' // 使用柱状图就加载bar模块，按需加载
	        ],
	        function (ec) {
	            // 基于准备好的dom，初始化echarts图表
	            var myChart = ec.init(document.getElementById('week')); 
	            
	            option = {
				    tooltip : {
				        trigger: 'axis'
				    },
				    legend: {
				        data:['微博','今日头条','微信']
				    },
				    toolbox: {
				        show : true,
				        feature : {
				            mark : {show: true},
				            dataView : {show: true, readOnly: false},
				            magicType : {show: true, type: ['line', 'bar', 'stack', 'tiled']},
				            restore : {show: true},
				            saveAsImage : {show: true}
				        }
				    },
				    calculable : true,
				    xAxis : [
				        {
				            type : 'category',
				            boundaryGap : false,
				            data : time
				        }
				    ],
				    yAxis : [
				        {
				            type : 'value'
				        }
				    ],
				    series : [
				        {
				            name:'微博',
				            type:'line',
				            data:wbolist
				        },
				        {
				            name:'今日头条',
				            type:'line',
				            data:ttlist2
				        },
				        {
				            name:'微信',
				            type:'line',
				            data:wxlist
				        }
				    ]
				};
	    
	            // 为echarts对象加载数据 
	            myChart.setOption(option); 
	        }
	    );
    </#if>
</#if>
	</script>
</html>